<!DOCTYPE html>
<html>
<head>
    {include file="layout:_meta" /}
</head>
<body>

<div class="layui-form"  style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">配置分组</label>
        <div class="layui-input-block">
            {form:select name="group" list="$groupList" value="$list['group']" default="[''=>'请选择配置分组']"  option="['lay-verify'=>'required','lay-reqtext'=>'请选择配置分组']"}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">输入框类型</label>
        <div class="layui-input-block">
            {form:select name="type" list="['input'=>'input输入框','textarea'=>'textarea输入框','image'=>'图片上传','select'=>'select选择框','radio'=>'radio选择框','layedit'=>'富文本编辑器']" value="$list['type']" default="[''=>'请选择输入框']"  option="['lay-filter'=>'type','lay-verify'=>'required','lay-reqtext'=>'输入框类型']"}
        </div>
    </div>
    <div class="layui-form-item" id="select"    {if condition="isset($list['type'])&&$list['type']=='select'"}{else/}style="display: none" {/if} >
        <label class="layui-form-label">选择项</label>
        <div class="layui-input-block">
            <input type="text" name="item"  placeholder="请输入选择项"  value="{:isset($list.item)?$list.item:''}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">配置key</label>
        <div class="layui-input-block">
            <input type="text" name="code"  lay-verify="required" placeholder="请输入数据key"  value="{:isset($list.code)?$list.code:''}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">配置value</label>
        <div class="layui-input-block">
            <input type="text" name="value" value="{:isset($list.value)?$list.value:''}" placeholder="请输入数据value"  lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="remark" lay-verify="required" placeholder="请输入备注" autocomplete="off" class="layui-textarea">{:isset($list.remark)?$list.remark:''}</textarea>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="hidden" name="id" value="{:isset($list['id'])?$list['id']:''}">
        <input type="button" lay-submit lay-filter="addEdit" id="addEdit" value="确认">
    </div>
</div>
{include file="layout:_footer" /}
<script>
    layui.use(['form'], function(){
        var form = layui.form,$ = layui.$;
        //监听type选择框
        form.on('select(type)', function(data){
            if(data.value=='select'){
                $('#select').show();
            }else{
                $('#select').hide();
            }
        });
    })
</script>
</body>
</html>
